package com.ddwl.goods.controller;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.BaseEnum;
import com.ddwl.common.controller.BaseController;
import com.ddwl.schema.bo.base.PageBo;
import com.ddwl.schema.bo.goods.SpikeBo;
import com.ddwl.schema.vo.base.PageVo;
import com.ddwl.schema.vo.base.RestVo;
import com.ddwl.schema.vo.goods.SpikeVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2019/8/15 10:58
 */
//@Api(tags = "秒杀抢购")
//@RequestMapping("spike")
//@RestController
public class SpikeController extends BaseController {


    @PostMapping("page")
    @Auth(product = BaseEnum.ProductEnum.CONSOLE)
    @ApiOperation("分页查询秒杀抢购")
    public RestVo<PageVo<SpikeVo>> page(@Valid @RequestBody PageBo<SpikeBo> pageBo) {
        return RestVo.ok();
    }

    @PostMapping("/create")
    @Auth(product = BaseEnum.ProductEnum.CONSOLE)
    @ApiOperation("创建秒杀抢购")
    public RestVo<String> create(@Valid @RequestBody SpikeBo bo) {
        return RestVo.ok();
    }

    @PostMapping("/update")
    @Auth(product = BaseEnum.ProductEnum.CONSOLE)
    @ApiOperation("创建秒杀抢购")
    public RestVo update(@Valid @RequestBody SpikeBo bo) {
        return RestVo.ok();
    }

    @DeleteMapping("del")
    @Auth(product = BaseEnum.ProductEnum.CONSOLE)
    @ApiOperation("删除秒杀抢购")
    public RestVo delete(@RequestParam String id) {
        return RestVo.ok();
    }

    @GetMapping("/detail")
    @Auth(required = false)
    @ApiOperation("条码搜索秒杀抢购")
    public RestVo<SpikeVo> detail(@ApiParam(value = "秒杀抢购ID", required = true) @RequestParam String id) {
        return RestVo.ok();
    }
}
